/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_revision_organos")
@NamedQueries({
    @NamedQuery(name = "CexRevisionOrganos.findAll", query = "SELECT c FROM CexRevisionOrganos c")})
public class CexRevisionOrganos implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cro_id")
    private Integer croId;
    @Column(name = "historia_historica")
    private Integer historiaHistorica;
    @Column(name = "cro_tipo")
    private Integer croTipo;
    @Column(name = "cro_observacion")
    private String croObservacion;
    @JoinColumn(name = "cco_id", referencedColumnName = "cco_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexConsulta cexConsulta;
    @JoinColumn(name = "cso_id", referencedColumnName = "cso_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexSistemasOrganos cexSistemasOrganos;
    @Transient
    private List<CexRevisionOrganos> listaHijos;

    public CexRevisionOrganos() {
    }

    public CexRevisionOrganos(Integer croId) {
        this.croId = croId;
    }

    public Integer getCroId() {
        return croId;
    }

    public void setCroId(Integer croId) {
        this.croId = croId;
    }

    public Integer getHistoriaHistorica() {
        return historiaHistorica;
    }

    public void setHistoriaHistorica(Integer historiaHistorica) {
        this.historiaHistorica = historiaHistorica;
    }

    public Integer getCroTipo() {
        return croTipo;
    }

    public void setCroTipo(Integer croTipo) {
        this.croTipo = croTipo;
    }

    public String getCroObservacion() {
        return croObservacion;
    }

    public void setCroObservacion(String croObservacion) {
        this.croObservacion = croObservacion;
    }

    public CexConsulta getCexConsulta() {
        return cexConsulta;
    }

    public void setCexConsulta(CexConsulta cexConsulta) {
        this.cexConsulta = cexConsulta;
    }

    public CexSistemasOrganos getCexSistemasOrganos() {
        return cexSistemasOrganos;
    }

    public void setCexSistemasOrganos(CexSistemasOrganos cexSistemasOrganos) {
        this.cexSistemasOrganos = cexSistemasOrganos;
    }

    public List<CexRevisionOrganos> getListaHijos() {
        return listaHijos;
    }

    public void setListaHijos(List<CexRevisionOrganos> listaHijos) {
        this.listaHijos = listaHijos;
    }
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (croId != null ? croId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexRevisionOrganos)) {
            return false;
        }
        CexRevisionOrganos other = (CexRevisionOrganos) object;
        if ((this.croId == null && other.croId != null) || (this.croId != null && !this.croId.equals(other.croId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.CexRevisionOrganos[ croId=" + croId + " ]";
    }

}
